package com.lz.d;

/**
 * @ClassName Demo40
 * @Description 方法调用的顺序
 * @Author 2214361854
 * @Date 2022/5/27 16:46
 * @Version 1.0
 */
public class Demo40 {
    /**
     * 通过方法调用-打印：
     * main() is start...
     * m1() is start...
     * m2() is start...
     * m1() is stop...
     * main() is stop...
     * */
    public static void main(String[] args) {
        System.out.println("main() is start...");
        m1();
        System.out.println("main() is stop...");
    }

    //2.创建m1()
    private static void m1() {
        System.out.println("m1() is start...");
        m2();
        System.out.println("m1() is stop...");
    }
    //3.创建m2()
    private static void m2() {
        System.out.println("m2() is start...");
    }
}